package com.zrf.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.zrf.service.RegService;



@RequestMapping("/ra")
@Controller
public class RegAction {

	@Autowired
	private RegService rs = null;
	
	@RequestMapping(value="buyerreg",params={"name","password"})
	public String buyerreg(@RequestParam("name") String name,@RequestParam("password") String password){
		
		try {
			if(rs.reg(name, password)){

				return "index";
			}
		} catch (Exception e) {
			e.printStackTrace();
			// TODO: handle exception
		}
		
		return "fail";
	}
}
